]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
StIcon: round icon size to an integer
authorOwen W. Taylor <otaylor@fishsoup.net>
Wed, 19 Jan 2011 16:34:10 +0000 (11:34 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Wed, 19 Jan 2011 16:54:03 +0000 (11:54 -0500)
Instead of converting a CSS-specified length to an integer by truncation,
round. This means that sizes specified by converting a pixel value into
non-px terms will work reliably instead of potentially being off-by-one.

src/st/st-icon.c

index 6101107f12a85b14c81f1fbaaf158616b910a6db..78519c4830d7acbc59d3d0a315916eff8278028f 100644 (file)
@@ -279,7 +279,7 @@ st_icon_style_changed (StWidget *widget)
   StThemeNode *theme_node = st_widget_get_theme_node (widget);
   StIconPrivate *priv = self->priv;
 
-  priv->theme_icon_size = st_theme_node_get_length (theme_node, "icon-size");
+  priv->theme_icon_size = (int)(0.5 + st_theme_node_get_length (theme_node, "icon-size"));
   st_icon_update_icon_size (self);
   st_icon_update (self);
 }